//
//  mGiftDetailResult.swift
//  ShopIOS
//
//  Created by Apple on 2019/8/8.
//  Copyright © 2019 Apple. All rights reserved.
//

import Foundation
import SwiftyJSON

struct mGiftDetailResult {
    var NeedGrade: Int = 0
    var DefaultShowImage: String?
    var EndDate: String?
    var Description: String?
    var VirtualSales: Int = 0
    var NeedIntegral: Int = 0
    var GiftValue: Int = 0
    var Sequence: Int = 0
    var SumSales: Int = 0
    var ShowLimtQuantity: String?
    var CanBuy: Bool = false
    var GiftName: String?
    var Id: Int = 0
    var CanNotBuyDes: String?
    var StockQuantity: Int = 0
    var ImagePath: String?
    var ShowSalesStatus: String?
    var AddDate: String?
    var RealSales: Int = 0
    var GetSalesStatus: Int = 0
    var NeedGradeName: String?
    var SalesStatus: Int = 0
    var Images = [String]()
    var GradeIntegral: Int = 0
    var ShowImagePath: String?
    var LimtQuantity: Int = 0
    
    init(json: JSON) {
        NeedGrade = json["NeedGrade"].intValue
        DefaultShowImage = json["DefaultShowImage"].stringValue
        EndDate = json["EndDate"].stringValue
        Description = json["Description"].stringValue
        VirtualSales = json["VirtualSales"].intValue
        NeedIntegral = json["NeedIntegral"].intValue
        GiftValue = json["GiftValue"].intValue
        Sequence = json["Sequence"].intValue
        SumSales = json["SumSales"].intValue
        ShowLimtQuantity = json["ShowLimtQuantity"].stringValue
        CanBuy = json["CanBuy"].boolValue
        GiftName = json["GiftName"].stringValue
        Id = json["Id"].intValue
        CanNotBuyDes = json["CanNotBuyDes"].stringValue
        StockQuantity = json["StockQuantity"].intValue
        ImagePath = json["ImagePath"].stringValue
        ShowSalesStatus = json["ShowSalesStatus"].stringValue
        AddDate = json["AddDate"].stringValue
        RealSales = json["RealSales"].intValue
        GetSalesStatus = json["GetSalesStatus"].intValue
        NeedGradeName = json["NeedGradeName"].stringValue
        SalesStatus = json["SalesStatus"].intValue
        Images = json["Images"].arrayValue.flatMap({$0.stringValue})
        GradeIntegral = json["GradeIntegral"].intValue
        ShowImagePath = json["ShowImagePath"].stringValue
        LimtQuantity = json["LimtQuantity"].intValue
    }
}
